package org.shopen.puremvc.controller
{
	import flash.events.Event;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.AsyncCommand;
	import org.shopen.puremvc.model.ManifestProxy;
	import org.shopen.puremvc.model.utils.CompleteDelegate;

	public class LoadManifestCommand extends AsyncCommand
	{
		override public function execute(notification:INotification):void
		{
			var proxy : ManifestProxy = facade.retrieveProxy(ManifestProxy.NAME) as ManifestProxy;
			var completeDelegate : CompleteDelegate = new CompleteDelegate();
			completeDelegate.addEventListener(CompleteDelegate.COMPLETE, loadCompleteListener);
			proxy.loadData(completeDelegate);
		}
		
		private function loadCompleteListener(event : Event) : void
		{
			commandComplete();
		}
	}
}